﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace MoneyManager
{
    static class TransactionManager
    {
        static public ObservableCollection<Transaction> Transactions { get; private set; }

        static TransactionManager()
        {
            Transactions = new ObservableCollection<Transaction>();
        }

        static public void Add(Transaction transaction)
        {
            Transactions.Add(transaction);
            if (transaction.Id == -1)
                DBManager.Insert(transaction);
        }

        static public void Remove(Transaction transaction)
        {
            Transactions.Remove(transaction);
        }
    }
}
